package cn.iocoder.yudao.module.trade.aftersale.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.AssertTrue;
import lombok.Data;

@Schema(description = "管理后台 - 售后订单同意 Request VO")
@Data
public class AfterSaleAgreeReqVO {

    @Schema(description = "售后编号，单个产品退款时使用", example = "1024")
    private Long id;

    @Schema(description = "订单编号，整单退款时使用", example = "1024")
    private Long orderId;

    @SuppressWarnings("unused")
    @AssertTrue(message = "售后编号和订单编号不能同时为空")
    public boolean validateAfterSaleIdAndOrderId() {
        return (id != null && id > 0) || (orderId != null && orderId > 0);
    }

    @Schema(description = "寄送姓名，退货时使用", requiredMode = Schema.RequiredMode.REQUIRED, example = "羡民")
    private String deliveryName;

    @Schema(description = "寄送手机号，退货时使用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1285116029")
    private String deliveryMobile;

    @Schema(description = "寄送区县编码，退货时使用", requiredMode = Schema.RequiredMode.REQUIRED, example = "520102")
    private Integer deliveryAreaId;

    @Schema(description = "寄送详细地址，退货时使用", requiredMode = Schema.RequiredMode.REQUIRED, example = "花果园金融街5号驰通集团公司")
    private String deliveryDetailAddress;

}
